package com.itstudio.myforumsystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itstudio.myforumsystem.entity.Article;
import com.itstudio.myforumsystem.entity.Type;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TypeMapper extends BaseMapper<Type> {
    @Select("select * from article a left join type t on t.id=a.typeid where t.id=#{id} limit 3")
    List<Article> findALLInforOfArticleByTypeNameLimit(Integer id);
@Select("select * from article a left join type t on t.id=a.typeid where t.name=#{name} ")
    List<Article> findALLInforOfArticleByTypeName(String name);
}
